package com.nicolasprof.profgallery.effects {
	import gs.TimelineLite;

	import com.nicolasprof.profgallery.Engine;
	import com.nicolasprof.profgallery.effects.Effect;

	import flash.display.Bitmap;

	/**
	 * @author Nicolas Prof
	 */
	public class FlareEffect extends Effect {
		public function FlareEffect() {
			super();
		}
		override public function build(...$layers) : void {
			var bitmap : Bitmap = $layers[0];
			var config: XML = getConfig();
			
			
			new TimelineLite({tweens:[[bitmap, 0.1, {colorTransform:{redOffset:255, greenOffset:255, blueOffset:255}}], [bitmap, config.@time, {colorTransform:{redOffset:0, greenOffset:0, blueOffset:0}}]], align:TimelineLite.ALIGN_SEQUENCE});
		}

		override protected function getConfig() : XML {
			var config : XML = Engine.CONFIG_XML;
			return config.effects.flare[0];
		}
	}
}
